package com.aipsi.cws.supplier;


import com.aipsi.cws.common.util.DataUtil.DataRandomGeneratorUtil;
import com.aipsi.cws.supplier.domain.Supplier;
import com.aipsi.cws.supplier.service.IAccountService;
import com.aipsi.cws.supplier.service.ISupplierService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.*;

/**
 * <P>
 *     随机生成数据
 * </P>
 * @author 大忽悠
 * @create 2022/3/26 16:25
 */
@SpringBootTest
@Slf4j
public class RandomDataGenerator {
    @Autowired
    private ISupplierService iSupplierService;
    @Test
    public void generatorRandomDatas1() throws InstantiationException, IllegalAccessException {
        Map<String,List> params=new HashMap<>();
        params.put("accountId",Arrays.asList(1,2,3,4,5,6,7,8,9,10));
        List list = DataRandomGeneratorUtil.randomGeneratorDatas(Supplier.class, 1000,params);
        iSupplierService.saveBatch(list);
    }
}
